﻿<%@ Page Language="C#" MasterPageFile="~/user/User.master" AutoEventWireup="true"
    CodeFile="ProductDetails.aspx.cs" Inherits="user_productDetails" Title="View Product" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register Src="FormComment.ascx" TagName="FormComment" TagPrefix="uc1" %>
<%@ Register src="RelatedProduct.ascx" tagname="RelatedProduct" tagprefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <title>View Product Details</title>
    <link href="../css/styles.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceSearch" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="content" runat="Server">
    <asp:DetailsView ID="DetailsViewProduct" runat="server" AutoGenerateRows="False"
        Width="750px" GridLines="None">
        <Fields>
            <asp:TemplateField>
                <ItemTemplate>
                    <div>
                        <div style="float: left; width: 400px; margin-left: 10px">
                            <strong>
                                <%#Eval("pd_name")%></strong>
                            <br />
                            <br />
                            <%#Eval("pd_description")%>
                        </div>
                        <div style="float: left; width: auto; margin-bottom: 20px">
                            <asp:Image ID="imageProduct" runat="server" ImageUrl='<%#Eval("pd_image")%>' Width="150"
                                Height="150" />
                        </div>
                        <div style="float: right; width: auto; margin-right: 5px;">
                            <strong>Price:
                                <%#String.Format("{0:0,0}",Eval("pd_price"))%>
                                $</strong>
                            <br />
                            <br />
                            <asp:ImageButton ID="ImagebtnAddtocard" runat="server" CommandArgument='<%#Eval("pd_id")%>'
                                CommandName="AddtoCard" ImageUrl="~/images/icon-add.jpg" OnCommand="ImagebtnAddtocard_Command" CausesValidation="False" />
                        </div>
                    </div>
                </ItemTemplate>
            </asp:TemplateField>
        </Fields>
    </asp:DetailsView>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
        
            <ajaxToolkit:Rating ID="RatingProduct" runat="server" EmptyStarCssClass="emptyRatingStar"
                FilledStarCssClass="filledRatingStar" StarCssClass="ratingStar" WaitingStarCssClass="savedRatingStar"
                CssClass="rating" CurrentRating="0" OnChanged="RatingProduct_Changed" AutoPostBack="True">
            </ajaxToolkit:Rating>
            &nbsp;<asp:Label ID="lblRating" runat="server" Font-Size="11px"></asp:Label>
            &nbsp;<asp:Label ID="LabelTotal" runat="server" Font-Size="11px" ForeColor="Red"></asp:Label>
            &nbsp;<asp:Label ID="LabelSumOfTotal" runat="server" Font-Size="11px" ForeColor="#00CC99"></asp:Label>
            &nbsp;<asp:Label ID="Label1" runat="server"></asp:Label>
            
            
        </ContentTemplate>
    </asp:UpdatePanel>
    <br />
    <hr style="color: Gray; width: 730px; margin-left: 10px" />
    <div class="usercomment">
        &nbsp;&nbsp;<img src="../images/comment.gif" alt="" />
        &nbsp;&nbsp;Total comment (<asp:Label ID="LabelTotalComment" runat="server" ForeColor="Red"></asp:Label>)
        <br />
        <asp:DetailsView ID="DetailsViewID" runat="server" Height="50px" Width="125px" AutoGenerateRows="False"
            GridLines="None">
            <Fields>
                <asp:TemplateField>
                    <ItemTemplate>
                        <iframe src="ShowComment.aspx?ID=<%#Eval("pd_id")%>" scrolling="auto" width="730px"
                            height="300px" frameborder="0"></iframe>
                    </ItemTemplate>
                </asp:TemplateField>
            </Fields>
        </asp:DetailsView>
        <br />
        <uc1:FormComment ID="FormComment1" runat="server" />
        
        <br />
    </div>
    <uc2:RelatedProduct ID="RelatedProduct1" runat="server" />
</asp:Content>
